package cn.itlaobing.servise;

import cn.itlaobing.BusinessException.MyBusinessException;
import cn.itlaobing.dao.ItlbAreasDao;
import cn.itlaobing.entity.ItlbAreas;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * 类名: cn.itlaobing.servise
 * 功能: itlbgoods的业务层
 * 作者: 王博
 * 日期: 2017/11/14 11:05
 */
public class ItlbAreasServise {

    private ItlbAreasDao iad=new ItlbAreasDao();

    /*
        查询所有区域
     */
    public List<ItlbAreas> addressArea() throws MyBusinessException {
        List<ItlbAreas> itlbAreases=null;
        try {
            itlbAreases=iad.QueryAllItlbAreas();
        } catch (SQLException e) {
            throw new MyBusinessException(e.getMessage());
        }
        if(itlbAreases==null){
            return null;
        }
        return itlbAreases.size()==0?null:itlbAreases;
    }
}
